package com.walle.ak47.commons.jaxrs.interceptor.monitor;

import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;

public class PerformanceStartInterceptor extends AbstractPhaseInterceptor<Message> implements PerformanceProtocol {

	public PerformanceStartInterceptor() {
		super(Phase.PRE_INVOKE);
	}

	public void handleMessage(Message message) throws Fault {
		message.getExchange().put(SETUP_MILLSCONDS, System.currentTimeMillis());
		message.getExchange().put(REQUEST_URI, message.get(Message.REQUEST_URI));
	}

}
